package com.hyhy.hycloud.commons.support;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.quartz.SchedulerFactoryBeanCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * @author lanpengfei
 * @date 2018/12/25
 */
@Configuration
@ConditionalOnClass({SchedulerFactoryBeanCustomizer.class, SchedulerFactoryBean.class})
public class SchedulerCustomizerConfig implements SchedulerFactoryBeanCustomizer {

    @Override
    public void customize(SchedulerFactoryBean schedulerFactoryBean) {
        schedulerFactoryBean.setOverwriteExistingJobs(true);
    }
}
